ceph-volume: honour osd_dmcrypt_key_size option
authorGuillaume Abrioux <gabrioux@redhat.com>
Tue, 25 Jan 2022 09:25:53 +0000 (10:25 +0100)
committerUtkarsh Gupta <utkarsh@debian.org>
Mon, 15 Dec 2025 12:18:10 +0000 (17:48 +0530)
commitb927d0403121c6dbb0f4d3ba8e4171132d546e35
treee3e2eed968e581ab641a621a58369e1aab87e24b
parentdc845cec7fba952f966b6b328d7a59d5cf73f258
ceph-volume: honour osd_dmcrypt_key_size option

ceph-volume doesn't honour osd_dmcrypt_key_size.
It means the default size is always applied.

It also changes the default value in `get_key_size_from_conf()`

From cryptsetup manpage:

> For XTS mode you can optionally set a key size of 512 bits with the -s option.

Using more than 512bits will end up with the following error message:

```
Key size in XTS mode must be 256 or 512 bits.
```

Fixes: https://tracker.ceph.com/issues/54006
Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
(cherry picked from commit 47c33179f9a15ae95cc1579a421be89378602656)

origin: https://github.com/ceph/ceph/commit/f69339e00f582ec64b843ff58b66817975fca0d7
bug: https://tracker.ceph.com/issues/54006

Gbp-Pq: Name CVE-2021-3979.patch
src/ceph-volume/ceph_volume/tests/util/test_encryption.py
src/ceph-volume/ceph_volume/util/encryption.py